﻿using mfLogger;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections;

namespace mfLogger.Test
{
    
    
    /// <summary>
    ///This is a test class for mfAppenderCollectionTest and is intended
    ///to contain all mfAppenderCollectionTest Unit Tests
    ///</summary>
    [TestClass()]
    public class mfAppenderCollectionTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for mfAppenderCollection Constructor
        ///</summary>
        [TestMethod()]
        public void mfAppenderCollectionConstructorTest()
        {
            mfAppenderCollection target = new mfAppenderCollection();
        }

        /// <summary>
        ///A test for Add
        ///</summary>
        [TestMethod()]
        public void AddTest()
        {
            mfAppenderCollection target = new mfAppenderCollection(); 
            ILoggerAppender value = new mfDebugAppender(); 
            int expected = 0; 
            int actual;
            actual = target.Add(value);

            Assert.AreEqual(expected, actual);

        }

        /// <summary>
        ///A test for AssertIfTypeIsInvalid
        ///</summary>
        [TestMethod()]
        [DeploymentItem("mfLogger.dll")]
        public void AssertIfTypeIsInvalidTest()
        {
            mfAppenderCollection_Accessor target = new mfAppenderCollection_Accessor(); 
            ILoggerAppender value = new mfDebugAppender(); 
            ILoggerAppender actual;

            actual = target.AssertIfTypeIsInvalid(value);

            Assert.AreEqual(value, actual);
        }


        /// <summary>
        ///A test for Contains
        ///</summary>
        [TestMethod()]
        public void ContainsTest()
        {
            mfAppenderCollection target = new mfAppenderCollection();
            ILoggerAppender value = new mfDebugAppender(); 
            bool expected = true;
            bool actual;

            target.Add(value);
            actual = target.Contains(value);

            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IndexOf
        ///</summary>
        [TestMethod()]
        public void IndexOfTest()
        {
            mfAppenderCollection target = new mfAppenderCollection();
            ILoggerAppender value = new mfDebugAppender(); 
            int startIndex = 0; 
            int count = 1; 
            int expected = 0; 
            int actual;

            target.Add(value);
            actual = target.IndexOf(value, startIndex, count);

            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IndexOf
        ///</summary>
        [TestMethod()]
        public void IndexOfTest1()
        {
            mfAppenderCollection target = new mfAppenderCollection();
            ILoggerAppender value = new mfDebugAppender(); 
            int startIndex = 0; 
            int expected = 0; 
            int actual;

            target.Add(value);
            actual = target.IndexOf(value, startIndex);

            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IndexOf
        ///</summary>
        [TestMethod()]
        public void IndexOfTest2()
        {
            mfAppenderCollection target = new mfAppenderCollection();
            ILoggerAppender value = new mfDebugAppender(); 
            int expected = 0; 
            int actual;

            target.Add(value);
            actual = target.IndexOf(value);

            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Insert
        ///</summary>
        [TestMethod()]
        public void InsertTest()
        {
            mfAppenderCollection target = new mfAppenderCollection();
            int index = 0; 
            ILoggerAppender value = new mfDebugAppender(); 

            target.Insert(index, value);

            Assert.AreEqual(target[0], value);
        }

        /// <summary>
        ///A test for Remove
        ///</summary>
        [TestMethod()]
        public void RemoveTest()
        {
            mfAppenderCollection target = new mfAppenderCollection(); 
            ILoggerAppender value = new mfDebugAppender();

            Assert.AreEqual(0, target.Count);
            target.Add(value);
            Assert.AreEqual(1, target.Count);
            target.Remove(value);
            Assert.AreEqual(0, target.Count);
        }

    }
}
